<template>
  <div class="thumb">
    <div class="thumb-m-cover">
      <a :href="'/v1/playlist/' + data.list_id">
        <PlayButton
          :duration="1000"
          :width="'64px'"
          :height="'64px'"
        ></PlayButton>
        <img
          class="thumb-img"
          :data-img="host + data.list_pic + data.list_pic_name"
        />
      </a>
    </div>
    <div class="thumb-m-name">
      <a href="javascript:void(0);">{{ data.list_name }}</a>
    </div>
    <div class="thumb-m-desc">
      <span>播放量： {{ (data.list_play_count / 10000).toFixed(1) }}万</span>
    </div>
  </div>
</template>

<script>
import { reactive, toRefs } from "vue";
import { host } from "@/configs/config";
export default {
  name: "SongListItem",
  props: {
    data: Object,
  },
  setup(props) {
    const state = reactive({
      imgParam: "?param=300y300",
    });

    return {
      ...toRefs(state),
      host,
    };
  },
};
</script>

<style lang='scss' scoped>
.thumb {
  padding: 0 14px;
  position: relative;
  .thumb-m-cover {
    position: relative;
    height: 100%;
    overflow: hidden;
    margin-bottom: 14px;
    &::after {
      content: "";
      display: block;
      padding-bottom: 100%;
    }
    a {
      position: absolute;
      display: block;
      width: 100%;
      height: 100%;
      overflow: hidden;
      &:hover {
        img {
          transform: scale(1.1);
        }
      }
    }
    img {
      height: 100%;
      transition: transform linear 0.35s;
    }
  }
  .thumb-m-name {
    margin-top: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    a {
      font-size: 16px;
      display: block;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      &:hover {
        color: $ThemeColor;
      }
    }
  }
  .thumb-m-desc {
    line-height: 34px;
    font-size: 12px;
    color: #8b8b8b;
    span {
      color: #999;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      height: 22px;
    }
  }
}
</style>
